package com.tmz.cloudmall.cloudmallware.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tmz.cloudmall.cloudmallware.mapper.PurchaseDetailMapper;
import com.tmz.cloudmall.cloudmallware.domain.PurchaseDetail;
import com.tmz.cloudmall.cloudmallware.service.IPurchaseDetailService;

/**
 * 购货详情Service业务层处理
 * 
 * @author tmz
 * @date 2025-08-16
 */
@Service
public class PurchaseDetailServiceImpl implements IPurchaseDetailService 
{
    @Autowired
    private PurchaseDetailMapper purchaseDetailMapper;

    /**
     * 查询购货详情
     * 
     * @param id 购货详情主键
     * @return 购货详情
     */
    @Override
    public PurchaseDetail selectPurchaseDetailById(Long id)
    {
        return purchaseDetailMapper.selectPurchaseDetailById(id);
    }

    /**
     * 查询购货详情列表
     * 
     * @param purchaseDetail 购货详情
     * @return 购货详情
     */
    @Override
    public List<PurchaseDetail> selectPurchaseDetailList(PurchaseDetail purchaseDetail)
    {
        return purchaseDetailMapper.selectPurchaseDetailList(purchaseDetail);
    }

    /**
     * 新增购货详情
     * 
     * @param purchaseDetail 购货详情
     * @return 结果
     */
    @Override
    public int insertPurchaseDetail(PurchaseDetail purchaseDetail)
    {
        return purchaseDetailMapper.insertPurchaseDetail(purchaseDetail);
    }

    /**
     * 修改购货详情
     * 
     * @param purchaseDetail 购货详情
     * @return 结果
     */
    @Override
    public int updatePurchaseDetail(PurchaseDetail purchaseDetail)
    {
        return purchaseDetailMapper.updatePurchaseDetail(purchaseDetail);
    }

    /**
     * 批量删除购货详情
     * 
     * @param ids 需要删除的购货详情主键
     * @return 结果
     */
    @Override
    public int deletePurchaseDetailByIds(Long[] ids)
    {
        return purchaseDetailMapper.deletePurchaseDetailByIds(ids);
    }

    /**
     * 删除购货详情信息
     * 
     * @param id 购货详情主键
     * @return 结果
     */
    @Override
    public int deletePurchaseDetailById(Long id)
    {
        return purchaseDetailMapper.deletePurchaseDetailById(id);
    }
}
